package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import o.cgz;
import o.chc;
import o.chy;
import o.ehv;
import o.epv;
import o.eqx;
import o.evx;
import o.ewm.j;

public class AppIconListCard extends BaseHorizontalItemCard {
    private TextView ʻ;
    private TextView ʼ;
    private ImageView ˋ;
    private TextView ᐝ;

    public AppIconListCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (ImageView) view.findViewById(j.ʽˉ);
        this.ʻ = (TextView) view.findViewById(j.ˇˊ);
        this.ᐝ = (TextView) view.findViewById(j.ʿᐨ);
        this.ˊˋ = (LinearLayout) view.findViewById(j.ʿˊ);
        this.ʼ = (TextView) view.findViewById(j.ㆍʼ);
        ʽ(view);
        int ˎ = epv.ˎ(this.ʼॱ, ʻ(), chc.ˋ());
        LayoutParams layoutParams = this.ˋ.getLayoutParams();
        layoutParams.height = ˎ;
        layoutParams.width = ˎ;
        this.ˋ.setLayoutParams(layoutParams);
        layoutParams = this.ʻ.getLayoutParams();
        layoutParams.width = ˎ;
        this.ʻ.setLayoutParams(layoutParams);
        return this;
    }

    private int ʻ() {
        return chc.ॱॱ();
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ehv) {
            ehv o_ehv = (ehv) cardBean;
            this.ʻ.setText(o_ehv.v_());
            this.ᐝ.setText(o_ehv.ˏˏ());
            ˋ(this.ʼ, o_ehv.ˋʻ());
            if (TextUtils.isEmpty(cardBean.ॱˑ())) {
                eqx.ˏ(this.ˋ, cardBean.ॱˌ(), "app_default_icon");
            } else {
                eqx.ॱ(this.ˋ, cardBean.ॱˑ(), "app_default_icon");
            }
        }
    }

    public void ॱ(final chy o_chy) {
        OnClickListener anonymousClass1 = new evx(this) {
            final /* synthetic */ AppIconListCard ˏ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ˏ);
            }
        };
        this.ˋ.setOnClickListener(anonymousClass1);
        ˉ().setOnClickListener(anonymousClass1);
    }
}
